columnview: Add sorting
authorMatthias Clasen <mclasen@redhat.com>
Wed, 4 Dec 2019 13:13:13 +0000 (08:13 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 30 May 2020 23:26:46 +0000 (19:26 -0400)
commit66500a6882cb6498b89b0e72513afdc942d2c39d
tree7d10d461f9be24d30262143353eca79b3d0bca06
parent2c4c07c96dc28a523b0af368900ecef9334d38d7
columnview: Add sorting

This is a somewhat large commit that:

- Adds GtkColumnViewSorter
This is a special-purpose, private sorter implementation which sorts
according to multiple sorters, allowing each individual sorter to be
inverted. This will be used with clickable column view headers.

- Adds a read-only GtkColumnView::sorter property
The GtkColumnView creates a GtkColumnViewSorter at startup that it uses
for this property.

- Adds a writable GtkColumnViewColumn::sorter property
This allows defining per-column sorters. Whenever an application sets a
sorter for a column, the header becomes clickable and whenever
a header is clicked, that column's sorter is prepended to the list of
sorters, unless it is already the first sorter, in which case we invert
its order. No column can be in the list more than once.
12 files changed:
docs/reference/gtk/gtk4-sections.txt
docs/reference/gtk/meson.build
gtk/gtkcolumnview.c
gtk/gtkcolumnview.h
gtk/gtkcolumnviewcolumn.c
gtk/gtkcolumnviewcolumn.h
gtk/gtkcolumnviewcolumnprivate.h
gtk/gtkcolumnviewprivate.h
gtk/gtkcolumnviewsorter.c [new file with mode: 0644]
gtk/gtkcolumnviewsorterprivate.h [new file with mode: 0644]
gtk/meson.build
testsuite/gtk/defaultvalue.c